package com.ruoyi.mq.kafka.controller;

import com.ruoyi.mq.kafka.producer.O1TemperatureProducer;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/kafka/test")
public class O1TestKafkaController {
    @Resource
    O1TemperatureProducer temperatureProducer;


    @GetMapping("/send")
    public String sendTemperature() {
        temperatureProducer.sendTemperatureData();
        return "温度数据已发送到 Kafka";
    }

    @GetMapping("/sendRsa")
    public String sendTemperatureWithRsa() {
        temperatureProducer.sendTemperatureWithRsa();
        return "温度数据已发送到 Kafka";
    }
}

